/*
 * @Author: xiawei 1243162387@qq.com
 * @Date: 2023-12-01 15:16:36
 * @LastEditors: xiawei 1243162387@qq.com
 * @LastEditTime: 2024-04-27 21:33:13
 */
import {createRouter, createWebHistory, RouteRecordRaw} from 'vue-router'
import Layout from '../layout/index.vue'

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        redirect: '/uicomp/table'
    },
    {
        name: 'UICom',
        path: '/uicomp',
        component: Layout,
        children: [
            {
                name: 'UICompTable',
                path: '/uicomp/table',
                component: () => import('../pages/table/index.vue')
            },
            {
                name: 'UICompForm',
                path: '/uicomp/form',
                component: () => import('../pages/form/index.vue')
            },
            {
                name: 'UICompTree',
                path: '/uicomp/tree',
                component: () => import('../pages/tree/index.vue')
            }, 
            {
                name: 'UICompUpload',
                path: '/uicomp/upload',
                component: () => import('../pages/upload/index.vue') 
            },          
             {
                name: 'UICompCode',
                path: '/uicomp/code',
                component: () => import('../pages/code.vue')
            }

        ]
    }
]

const router = createRouter({
    scrollBehavior: () => ({left: 0, top: 0}),
    history: createWebHistory(),
    routes
})
router.beforeEach((_to, _from, next) => {  
    next()
})

export default router



